﻿<UserControl
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	xmlns:avalonedit="http://icsharpcode.net/sharpdevelop/avalonedit"
	mc:Ignorable="d"
	x:Class="ViewTraitement"
	d:DesignWidth="640" d:DesignHeight="480">

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition/>
            <RowDefinition Height="5"/>
            <RowDefinition Height="Auto" Name="utilitiesRow"/>
        </Grid.RowDefinitions>
        <Grid  >
            <Grid.ColumnDefinitions>
                <ColumnDefinition/>
                <ColumnDefinition/>
            </Grid.ColumnDefinitions>
            <ComboBox/>
            <StackPanel Orientation="Horizontal" Grid.Column="1" HorizontalAlignment="Center">
                <Button Content="Compiler" Command="{Binding CompileCommand}"  d:LayoutOverrides="Height"  Padding="10,1"/>
                <Button Content="Executer" Command="{Binding ExecuteCodeCommand}"  d:LayoutOverrides="Height"  Padding="10,1"/>
                <Button Content="Formater"   Padding="10,1" Name="Button1" />

            </StackPanel>
        </Grid>
        <Border Grid.Row="1" BorderBrush="Black" BorderThickness="1" >
            <Grid>
                <avalonedit:TextEditor Name="codeEditor" TextChanged="codeEditor_TextChanged"  />
                <RichTextBox Visibility="Collapsed" Name="codeFormater" />
            </Grid>
        </Border>
        <GridSplitter HorizontalAlignment="Stretch" Grid.Row="2" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"/>
        <Grid Grid.Row="3">
            <Expander Header="Panneau utilitaires" Name="utilitiesExpander"
                      Background="{x:Null}" BorderBrush="{x:Null}">
                <TabControl Margin="20,3,0,0">
                    <TabItem Header="Tout">
                        <DataGrid ItemsSource="{Binding CompilerErrorsAll}" Background="#FFE5E5E5">
                            <DataGrid.Columns>
                                <DataGridTemplateColumn Header="" SortMemberPath="IsWarning">
                                    <DataGridTemplateColumn.CellTemplate>
                                        <DataTemplate>
                                            <Ellipse HorizontalAlignment="Center" VerticalAlignment="Center"  Width="10" Height="10" Name="levelEllipse" />
                                            <DataTemplate.Triggers>
                                                <DataTrigger Binding="{Binding IsWarning}" Value="False">
                                                    <Setter TargetName="levelEllipse" Property="Fill" Value="Red" />
                                                </DataTrigger>
                                                <DataTrigger Binding="{Binding IsWarning}" Value="False">
                                                    <Setter TargetName="levelEllipse" Property="Fill" Value="Red" />
                                                </DataTrigger>
                                            </DataTemplate.Triggers>
                                        </DataTemplate>
                                    </DataGridTemplateColumn.CellTemplate>
                                </DataGridTemplateColumn>
                                <DataGridTextColumn Header="Ligne" Binding="{Binding Path=Line, Mode=OneWay}" />
                                <DataGridTextColumn Header="Colonne" Binding="{Binding Path=Column, Mode=OneWay}" />
                                <DataGridTextColumn Header="Message" Binding="{Binding Path=ErrorText, Mode=OneWay}" />
                            </DataGrid.Columns>
                        </DataGrid>
                    </TabItem>
                    <TabItem Header="Erreurs">
                        <DataGrid ItemsSource="{Binding CompilerErrorsHard}" Background="#FFE5E5E5">
                            <DataGrid.Columns>
                                <DataGridTextColumn Header="Ligne" Binding="{Binding Path=Line, Mode=OneWay}" />
                                <DataGridTextColumn Header="Colonne" Binding="{Binding Path=Column, Mode=OneWay}" />
                                <DataGridTextColumn Header="Message" Binding="{Binding Path=ErrorText, Mode=OneWay}" />
                            </DataGrid.Columns>
                        </DataGrid>
                    </TabItem>
                    <TabItem Header="Avertissements">
                        <DataGrid ItemsSource="{Binding CompilerErrorsSoft}" Background="#FFE5E5E5">
                            <DataGrid.Columns>
                                <DataGridTextColumn Header="Ligne" Binding="{Binding Path=Line, Mode=OneWay}" />
                                <DataGridTextColumn Header="Colonne" Binding="{Binding Path=Column, Mode=OneWay}" />
                                <DataGridTextColumn Header="Message" Binding="{Binding Path=ErrorText, Mode=OneWay}" />
                            </DataGrid.Columns>
                        </DataGrid>
                    </TabItem>
                    <TabItem Header="Informations">
                        <DataGrid  Background="#FFE5E5E5" ItemsSource="{Binding CodeResult}"/>
                    </TabItem>
                    <TabItem Header="Aide">
                        <RichTextBox Height="200" IsReadOnly="True" >
                            <FlowDocument>
                                <Paragraph 
								FontSize="16" 
								FontFamily="Calibri" Margin="0,0,0,13"
								 TextAlignment="Justify">
                                    <Span FontWeight="Bold" 
									     FontSize="18.6666666666667" Language="fr-fr">
                                        <Run Text="OMANE "/>
                                    </Span>
                                    <Span Language="fr-fr">
                                        <Run Text=" est un outil d'analyse de l'activité Assurance Des Emprunteurs "/>
                                    </Span>
                                    <Span Background="Yellow" FontWeight="Bold" Language="fr-fr">
                                        <Run Text="(ADE"/>
                                    </Span>
                                    <Span Background="Yellow" FontWeight="Bold" Language="fr-fr">
                                        <Run Text=")"/>
                                    </Span>
                                    <Span Background="Yellow" FontWeight="Bold" Language="fr-fr">
                                        <Run Text="."/>
                                    </Span>
                                    <Span Language="fr-fr">
                                        <Run Text=" Il a pour but de fournir un certain nombre "/>
                                    </Span>
                                    <Span Background="Blue" Foreground="#FF948A54" FontStyle="Italic" Language="fr-fr" TextDecorations="Underline">
                                        <Run Text="de fonctionnalités"/>
                                    </Span>
                                    <Span Foreground="#FF548DD4" FontStyle="Italic" Language="fr-fr" TextDecorations="Underline">
                                        <Run Text=" "/>
                                    </Span>
                                    <Span Language="fr-fr">
                                        <Run Text="permettant de piloter cette activité. De fait il consomme des données, puis il les traite en vue de générer des "/>
                                    </Span>
                                    <Run FontSize="18.6666666666667" Language="fr-fr" Text="RAPPORTS. "/>
                                </Paragraph>
                            </FlowDocument>
                        </RichTextBox>
                    </TabItem>

                </TabControl>
            </Expander>
        </Grid>
    </Grid>
</UserControl>